package com.xyx.ssm.jdbcdao;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.xyx.ssm.po.Purchase;
import com.xyx.ssm.po.Purchasesub;

@Repository
public class PurchaseDao extends BaseDao {

	public int insertpruchase(Purchase purchase) {
		int num = sqlSession.insert(
				"com.xyx.ssm.jdbcdao.PurchaseDao.insertpurchase", purchase);
		return num;
	}

	public List<Map<String, Object>> selectWineproduct(Purchase purchase) {
		List<Map<String, Object>> list = sqlSession.selectList(
				"com.xyx.ssm.jdbcdao.PurchaseDao.selectwineproduct", purchase);
		return list;

	}

	public List<Purchase> selectdetail(Purchase purchase) {
		List<Purchase> list = sqlSession.selectList(
				"com.xyx.ssm.jdbcdao.PurchaseDao.selectdateail", purchase);
		return list;

	}

	public List<Purchase> selectdetailwine(Purchase purchase) {
		List<Purchase> list = sqlSession.selectList(
				"com.xyx.ssm.jdbcdao.PurchaseDao.selectdateailwine", purchase);
		return list;

	}

	public int insertwinepurchasesub(Purchasesub purchasesub) {
		int num = sqlSession.insert(
				"com.xyx.ssm.jdbcdao.PurchaseDao.insertwinepurchasesub",
				purchasesub);
		return num;

	}

	public int updatepurchase(Purchase purchase) {
		int num = sqlSession.update(
				"com.xyx.ssm.jdbcdao.PurchaseDao.updatepurchase", purchase);
		return num;

	}
}
